<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>字符串大小写转换</title>
    <style>
            a:link,a:visited{
                color: #222;text-decoration: none;}
           a:hover{color: #fd4913;}
       </style>
   
</head>
<body>
    <h2>字符串大小写转换</h2>
    <p>原操作：<input id="old" type="text"></p>
    <p>操作：
            <input type="button" value="转大写"  onclick="deal('upper')">
            <input type="button" value="转小写"  onclick="deal('lower')"></p>
    <p>新数据：<input id="new" type="text"></p>
    <script>
        function deal(opt){
            var str=document.getElementById('old').value;
            switch(opt){
                case 'upper':
                str=str.toUpperCase();
                break;
                case 'lower':
                str=str.toLowerCase();
                break;
            }
            document.getElementById('new').value=str;
        }
    </script>
    <p><a href="default.html">返回目录</a></p>
    <p><a href="第四章.html">返回第四章</a></p>
    <p><a href="斐波那契数列第N项的值.html">下一题</a></p>
    <p><a href="第五章.html">下一章</a></p>
</body>
</html>